﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NF_Tools
{
    public partial class SearchDropDownList : UserControl
    {
        public SearchDropDownList()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 经度
        /// </summary>
        public string Longitude { get; set; }

        /// <summary>
        /// 维度
        /// </summary>
        public string Latitude { get; set; }


        //private void SearchResult_CellClick(object sender, DataGridViewCellEventArgs e)
        //{
            //if (e.ColumnIndex == -1 || e.RowIndex == -1) return;
            //if (SearchResult.Columns[e.ColumnIndex] is DataGridViewTextBoxColumn)
            //{
            //    txtnamebox.Text = SearchResult.Rows[e.RowIndex].Cells["name"].Value.ToString();
            //    Longitude = SearchResult.Rows[e.RowIndex].Cells["longitude"].Value.ToString();
            //    Latitude = SearchResult.Rows[e.RowIndex].Cells["latitude"].Value.ToString();
            //    if (!string.IsNullOrEmpty(txtnamebox.Text))
            //    {
            //        this.SearchResult.MouseLeave += SearchResult_MouseLeave;
            //    }
            //}
       // }

        private void SearchResult_MouseLeave(object sender, EventArgs e)
        {
           
            this.Height = this.txtnamebox.Height;
        }

        public delegate void DvgTxtClickDelegate(object sender, EventArgs e);
        public event DvgTxtClickDelegate DvgLostFocusClickEvent;


       

        private void picSearch_Click(object sender, EventArgs e)
        {
            if (DvgLostFocusClickEvent != null)
                DvgLostFocusClickEvent(this, e);
        }
    }
}
